﻿<div ng-controller="playingController">
    <div class="wrapper border-bottom white-bg page-heading">
        <div class="col-lg-pull-12">
            <ol class="breadcrumb">
                <li>赛事</li>
            </ol>
        </div>
    </div>

    <form class="form-horizontal row">
        <div class="form-group">
            <div class="col-sm-3">
                <label class="col-sm-5 control-label">队伍</label>
                <div class="col-sm-7">
                    <input name="team_title" type="text" class="form-control input-sm" ng-model="query.team_title">
                </div>
            </div>
            <div class="col-sm-3">
                <label class="col-sm-4 control-label">比赛模式</label>
                <div class="col-sm-8">
                    <div class="col-sm-12">
                        <select name="type" class="form-control input-sm" ng-model="query.type">
                            <option value="">请选择</option>
                            <option ng-repeat="x in model.e_playing_type_list" value="{{x.value}}">{{x.text}}</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <label class="col-sm-3 control-label">比赛时间</label>
                <div class="col-sm-9">
                    <div date class="input-group date">
                        <input class="form-control input-sm" ng-model="query.begin_time">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>

                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <label class="col-sm-1 control-label">至</label>
                <div class="col-sm-9">
                    <div date class="input-group date">
                        <input class="form-control input-sm" ng-model="query.end_time">
                        <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-4">
                <div class="col-sm-offset-4 col-sm-8">
                    <button class="btn btn-primary btn-sm" ng-click="search()"><i class="fa fa-search"></i> 查询</button>
                    <button class="btn btn-primary btn-sm" ui-sref="app.playing.detail()"><i class="fa fa-plus"></i> 添加</button>
                </div>
            </div>
        </div>
    </form>
    <table style="table-layout:fixed;" class="table table-hover m-t-md">
        <thead>
            <tr style="background-color: #f7f7f9;">
                <th>序号</th>
                <th>比赛模式</th>
                <th>比赛时间</th>
                <th>参与截止时间</th>
                <th>主队</th>
                <th>图片</th>
                <th>队伍说明</th>
                <th>客队</th>
                <th>图片</th>
                <th>队伍说明</th>
                <th>胜利队伍</th>
                <th width="130">操作</th>
            </tr>
        </thead>
        <tbody ng-repeat="item in model.data.rows">
            <tr>
                <td>{{$index+1}}</td>
                <td>{{item.play_type_title}}</td>
                <td>{{item.play_time}}</td>
                <td>{{item.participation_end_time}}</td>
                <td>{{item.home_team.title}}</td>
                <td><img ng-show="item.home_team.img_url != null" height="30" width="30" src="{{site.img_url+item.home_team.img_url}}" /></td>
                <td style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-height:30px;width:100%;display:inline-block;"><span ng-bind-html="item.home_team.content == null ? '' : item.home_team.content"></span></td>
                <td>{{item.guest_team.title}}</td>
                <td><img ng-show="item.guest_team.img_url != null" height="30" width="30" src="{{site.img_url+item.guest_team.img_url}}" /></td>
                <td style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-height:30px;width:100%;display:inline-block;"><span ng-bind-html="item.guest_team.content == null ? '' : item.guest_team.content"></span></td>
                <td>{{item.win_team_id == null ? "未设置" : item.win_team_id ==0 ? "平局" : item.win_team.title}}</td>
                <td>
                    <a ng-if="item.win_team_id == null" class="btn btn-primary btn-xs" ui-sref="app.playing.detail({id:{{item.id}}})"><i class="fa fa-cog"></i> 修改</a>
                    <a ng-if="item.win_team_id != null" class="btn btn-primary btn-xs" ui-sref="app.playing.detail({id:{{item.id}}})"><i class="fa fa-cog"></i> 查看</a>
                </td>
            </tr>
        </tbody>
    </table>
    <div class="row">
        <div class="col-md-12">
            <uib-pagination total-items="model.data.total_result" items-per-page="model.data.size" ng-model="model.data.page" num-pages="model.data.total_pages"
                            ng-change="search_page(model.data.page)" class="pagination-sm" boundary-links="true" boundary-link-numbers="true" max-size="20"
                            previous-text="&lsaquo;" next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></uib-pagination>
            <span class="pull-right" style="margin: 30px 0px 20px 0px">共{{model.data.total_result}} 当前：{{model.data.page}}/{{model.data.total_pages}}</span>
        </div>
    </div>
</div>
